/*
* 顾客信息表
*/
import request from '@/router/axios'

// 获取顾客列表信息
export function fetchCustomerList(query) {
  return request({
    url: '/eims/customer/getCustomerDTOPage',
    method: 'get',
    params: query
  })
}

// 新增顾客信息
export function addCustomerObj(obj) {
  return request({
    url: '/eims/customer',
    method: 'post',
    data: obj
  })
}

// 根据ID查询顾客信息
export function getCustomerObj(id) {
  return request({
    url: '/eims/customer/' + id,
    method: 'get'
  })
}

// 删除顾客信息
export function delCustomerObj(id) {
  return request({
    url: '/eims/customer/' + id,
    method: 'delete'
  })
}

// 修改顾客信息
export function putCustomerObj(obj) {
  return request({
    url: '/eims/customer',
    method: 'put',
    data: obj
  })
}

//  根据ID仅查询会员信息
export function getCustomerInfoObj(id) {
  return request({
    url: '/eims/customer/getSimpleCustomerById/'+id,
    method: 'get'
  })
}


//  根据会员卡号查询销售信息
export function getSaleInfoPage(obj) {
  return request({
    url: '/eims/customer/getSaleInfoPage',
    method: 'get',
    params: obj
  })
}

//  根据会员卡号查询病例信息
export function getCaseInfoPage(obj) {
  return request({
    url: '/eims/customer/getCaseInfoPage',
    method: 'get',
    params: obj
  })
}


//  根据会员卡号查询回访记录
export function getFeedbackInfo(obj) {
  return request({
    url: '/eims/customer/getFeedbackInfoPage',
    method: 'get',
    params: obj
  })
}


//  根据会员卡号查询储值卡记录
export function getCreditCardInfo(obj) {
  return request({
    url: '/eims/customer/getCreditCardInfoPage',
    method: 'get',
    params: obj
  })
}


//  根据会员卡号查询储值卡记录
export function getCreditCardDetailBySaleBillId(billId) {
  return request({
    url: '/eims/customer/getCreditCardDetail/' + billId,
    method: 'get'
  })
}

export function getCustomerByCardNo(cardNo) {
  return request({
    url: '/eims/customer/getByCardNo',
    method: 'get',
    params: {cardNo: cardNo}
  })
}

// 根据PersonId查询会员卡号
export function getCustomerCardByPersonId(personId) {
  return request({
    url: '/eims/customer/getCustomerCardByPersonId/' + personId,
    method: 'get'
  })
}

// 根据personId查询会员销售信息
export function getSaleInfoPageByPersonId(personId) {
  return request({
    url: '/eims/customer/getSaleInfoPageByPersonId/' + personId,
    method: 'get'
  })
}


// 分页查询顾客未回购信息
export function getCustomerAgianPlayPage(query) {
  return request({
    url: '/eims/customer/getCustomerAgianPlayPage',
    method: 'get',
    params: query
  })
}

// 根据billId查询验光信息
export function getCustomerOptometryByBillId(billId){
  return request({
    url: '/eims/saleOptometry/getByBillId/'+billId,
    method: 'get'
  })
}


// 根据就诊卡号从HIS获取客户信息
export function getCustomerInfoByVisit(visitCard){
  return request({
    url: '/eims/customer/getHisInfo/' + visitCard,
    method: 'get'
  })
}